<?php

/**
 * WeEngine System
 *
 * (c) We7Team 2021 <https://www.w7.cc>
 *
 * This is not a free software
 * Using it under the license terms
 * visited https://www.w7.cc for more details
 */

namespace W7\Addons\demo_engine_wechat\Upgrade105;

use W7\Sdk\OpenCloud\Contracts\ModuleUpgradeInterface;

class Up implements ModuleUpgradeInterface
{
    public function database(): array
    {
        $sql[] = <<<EOF
CREATE TABLE IF NOT EXISTS `ims_account105` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_group_id` int(10) NOT NULL DEFAULT '0' COMMENT 'user_group表所属ID',
`username` varchar(30) NOT NULL COMMENT '用户名',
PRIMARY KEY(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户表';
EOF;
        $sql[] = "INSERT INTO `ims_account105` (`user_group_id`, `username`) VALUES (10, 'admin');";
        return $sql;
    }
    
    public function script(): bool
    {
        file_put_contents('./aaa.txt', 105);
        return true;
    }
}
